package com.esunrising.esungsc.controller;

import com.esunrising.esungsc.dto.FIGLZWPZ;
import com.esunrising.esungsc.entity.BFCustomItem;
import com.esunrising.esungsc.service.FIGLAccountingDocumentService;
import com.esunrising.esungsc.service.GSCService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/gsc")
@Api(value = "/api/v1/gsc", tags = {"GSC接口处理模块"})
@Slf4j
public class FIGLAccountingDocumentController {

    @Autowired
    private FIGLAccountingDocumentService figlAccountingDocumentService;

    /**
     * 获取凭证列表数据
     * @return
     */
    @GetMapping("/voucherList")
    public Object voucherList(){

        String year = "2024";
        String accOrgID = "03038";
        String lastChangedOn = "2024-01-01 02:00:48";
        String endTime = "2024-05-09 13:44:00";
        String isFinish = "0";
        String isBook = "0";
        int page = 1;
        int num = 1000;

        List<FIGLZWPZ> apiVoucherList = figlAccountingDocumentService.getApiVoucherList(year,accOrgID,lastChangedOn, endTime, isFinish, isBook, page, num);
        figlAccountingDocumentService.syncAccZWPZList(apiVoucherList);
        return apiVoucherList;
    }


}
